home *** CD-ROM | disk | FTP | other *** search
- var err = UNEXPECTED_ERROR;
-
- try {
- err = initInstall(
- "minimizetotray",
- "@mook.example.com/minimizetotray,version=0.0.1",
- "0.0.1.20040828+");
- if (err)
- throw('initInstall: ' + err);
-
- // Windows only, for now.
- // TODO: figure out the difference between Win32 and Win64
- {
- var plat = new String(Install.platform);
- plat = plat.substring(0,3);
- if (plat != 'Win') {
- err = UNABLE_TO_LOAD_LIBRARY;
- throw(
- 'This package contains binary components ' +
- 'that are designed for Windows only. Help me port it.');
- }
- }
-
- var chromeFolder = Install.getFolder("Profile", "Chrome");
-
- err = Install.addFile("jar",
- "chrome/minimizetotray.jar",
- chromeFolder,
- null);
- if (err)
- throw('addFile: jar: ' + err);
-
- var jarFile = Install.getFolder(chromeFolder, "minimizetotray.jar");
-
- err = Install.registerChrome(
- PACKAGE | PROFILE_CHROME,
- jarFile,
- "content/minimizetotray/");
- if (err)
- throw('registerChrome: chrome: ' + err);
-
- err = Install.registerChrome(
- LOCALE | PROFILE_CHROME,
- jarFile,
- "locale/fr-FR/minimizetotray/");
- if (err)
- throw('registerChrome: locale: ' + err);
-
- err = Install.registerChrome(
- SKIN | PROFILE_CHROME,
- jarFile,
- "skin/classic/minimizetotray/");
- if (err)
- throw('registerChrome: skin: ' + err);
-
- var componentsFolder = Install.getFolder("Components");
-
- err = Install.addFile("components",
- "components/mintray-4154cd80-20040828.dll",
- componentsFolder,
- null);
- if (err)
- throw('addFile: bin: ' + err);
-
- err = Install.addFile("components",
- "components/minimizetotray.xpt",
- componentsFolder,
- null);
- if (err)
- throw('addFile: xpt: ' + err);
-
- err = Install.performInstall();
- if (err)
- throw('performInstall: ' + err);
-
- err = SUCCESS;
-
- } catch (message) {
- logComment('catching something');
- logComment('err is ' + err);
- // we can't possibly be trying to catch no error
- if (SUCCESS == err)
- err = getLastError() || SCRIPT_ERROR;
- logComment(message);
- cancelInstall(err);
- }
-
-